Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Desugar AST::ForLoopExprs as part of HIR lowering #2903

Draft
wants to merge 35 commits into
base: master
Choose a base branch
from

Conversation

CohenArthur
Copy link
Member

@CohenArthur CohenArthur commented Mar 5, 2024

No description provided.

@CohenArthur CohenArthur force-pushed the desugar-for-loops branch 3 times, most recently from 1c9b0e9 to 69a935b Compare March 6, 2024 15:41
@CohenArthur
Copy link
Member Author

This is causing a lot of issues and they are really annoying to fix... we can probably experiment with definning println!() with an iterator rather than a for-loop

@powerboat9
Copy link
Contributor

Still applicable?

@CohenArthur
Copy link
Member Author

Still applicable?

Yeah, I think I'll use that branch as the basis for the remaining for-loop work which depends on #3290 being merged. So hopefully we can close this out relatively soon

@CohenArthur CohenArthur force-pushed the desugar-for-loops branch 3 times, most recently from 1fe3c7a to 6dcace8 Compare December 22, 2024 17:12
gcc/rust/ChangeLog:

	* hir/tree/rust-hir-path.h: Adapt PathPattern to accept lang-item paths.
	* hir/tree/rust-hir-path.cc: Assert we are dealing with a segmented path, create lang-item constructors.
	* hir/tree/rust-hir.cc (PathPattern::convert_to_simple_path): Likewise.
This commit adds things like Item::Kind, Expr::Kind, etc, and implements the associated `get_*_kind` functions.
It also removes the more generic AST::Kind enum we were using, which was incomplete and painful to use.

gcc/rust/ChangeLog:

	* ast/rust-ast.h: Add new Kind enums, remove Node class.
	* ast/rust-builtin-ast-nodes.h: Use new Kind enums.
	* ast/rust-expr.h (class LoopLabel): Likewise.
	* ast/rust-item.h: Likewise.
	* ast/rust-macro.h: Likewise.
	* ast/rust-path.h: Likewise.
	* expand/rust-macro-builtins-helpers.cc: Likewise.
	* expand/rust-macro-builtins-utility.cc (MacroBuiltin::concat_handler): Likewise.
	(MacroBuiltin::stringify_handler): Likewise.
	* resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Likewise.
	* resolve/rust-early-name-resolver.cc (EarlyNameResolver::accumulate_escaped_macros): Likewise.
	(EarlyNameResolver::visit): Likewise.
This commit adds new methods for building pattern nodes, match expressions and more precise call expressions.

gcc/rust/ChangeLog:

	* ast/rust-ast-builder.cc: Add new functions.
	* ast/rust-ast-builder.h: Declare them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants